#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n, a[100001], b[100001], c[100001];

inline void quicksort(ll l, ll r) {
	if (l >= r)
		return;
	ll x = a[l + rand() % (r - l + 1)];
	ll l1 = 0, l2 = 0, y = 0;
	for (ll i = l; i <= r; ++i) 
		if (a[i] < x)
			b[++l1] = a[i];
		else if (a[i] > x)
			c[++l2] = a[i];
		else
			++y;
	for (ll i = 1; i <= l1; ++i)
		a[i + l - 1] = b[i];
	for (ll i = 1; i <= y; ++i)
		a[i + l + l1 - 1] = x;
	for (ll i = 1; i <= l2; ++i)
		a[i + l + l1 + y - 1] = c[i];
	quicksort(l, l + l1 - 1);
	quicksort(l + l1 + y, r);
}

int main() {
	scanf("%lld", &n);
	for (ll i = 1; i <= n; ++i)
		scanf("%lld", &a[i]);
	quicksort(1, n);
	for (ll i = 1; i <= n; ++i)
		printf("%lld ", a[i]);
	printf("\n");
	return 0;
}
